<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

    <%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<!DOCTYPE HTML>
<html>
<head>
    <base href="${basePath}">  
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<link rel="stylesheet" type="text/css" href="static/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="static/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="static/css/Hui-iconfont/1.0.7/iconfont.css" />
<link rel="stylesheet" type="text/css" href="static/css/icheck/icheck.css" />
<link rel="stylesheet" type="text/css" href="static/css/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="static/css/style.css" /> 
 <link href="static/css/bootstrap.min.css" rel="stylesheet">
    <link href="static/css/dashboard.css" rel="stylesheet">
<title>员工管理</title>
<style>
	.zeng input:hover{
		background: grey;
	}
	#hint{
	color:red;
	}
</style>
</head>
<body>
<jsp:include page="../dingheader.jsp" />
	<jsp:include page="../zuoheader.jsp" />
<div class="page-container">
<form action="staff?method=selectby" method="post">
	<div class="text-c"> 
		<input type="text" name="dates"  placeholder="入职时间"  value="${param.dates }"  style="width:120px;height:28px;" onfocus="HS_setDate(this)" >
		<input type="text" name="names" id="" placeholder="姓名"   value="${param.names }"  style="width:120px" class="input-text" value="${param.names }">
	<%-- 	<input type="text" name="phones"  value="${param.phones }"  id="" placeholder="电话" style="width:120px" class="input-text">
		<input type="text" name="addresss" id="" value="${param.addresss }" placeholder="地址" style="width:120px" class="input-text"> --%>
		性别
		<select name="sexs"  style="width:120px;height:28px;">
		<option selected="selected" value="">请选择</option>
			<option value="1" >男</option>
			<option value="0" >女</option>
		</select>
		状态
		<select name="status"  style="width:120px;height:28px;">
			<option selected="selected" value="">请选择</option>
			<option value="1" >在职</option>
			<option value="0">离职</option>
		</select>
		部门
		<select name="depts"  style="width:120px;height:28px;">
				<option selected="selected" value="">请选择</option>
				<c:forEach items="${deptlist }" var="dept">
						<option value="${dept.deptId}" ${param.depts == dept.deptId?'selected':''} >${dept.deptName }</option>
				</c:forEach>
		</select>
		职位
		<select name="positions"  style="width:120px;height:28px;" >
			<option selected="selected" value="">请选择</option>
			<c:forEach items="${poslist }" var="pos">
			
						<option value="${pos.positionId}"${param.positions==pos.positionId?'selected':'' }>${pos.positionName }</option>
			</c:forEach>
		</select>
		<button name="" id="" class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 查询</button>
	</div>
	</form>
	<div>${errors }</div>
	<div class="cl pd-5 bg-1 bk-gray mt-20">
	 <span class="l" id="delete"><a href="javascript:;" onclick="datadel()" class="btn btn-danger radius">
	 <i class="Hui-iconfont">&#xe6e2;</i> 批量离职</a> 
	 <a class="btn btn-primary radius" onclick="picture_add('添加图片','picture-add.html')" href="javascript:;" id="add">
	 <i class="Hui-iconfont">&#xe600;</i> 添加员工</a></span> <span class="r">共有数据：<strong>${allcount }
	 </strong> 条</span> </div>
	<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-hover table-sort">
			<thead>
				
				<tr class="text-c">
					<th width="40"><input name="" type="checkbox" value="" id="checkAll"></th>
					<th width="80">姓名</th>
					<th width="100">性别</th>
					<th width="100">地址</th>
					<th width="150">电话</th>
					<th width="120">邮箱</th>
					<th width="70">职位</th>
					<th width="80">所属部门</th>
					<th width="50">状态</th>
					<th width="210">入职时间</th>
					<th width="100">操作</th>
				</tr>
			
			</thead>
			<tbody>
			<c:if test="${empty list }">
			<tr class="text-c"><th colspan="11">无记录</th></tr>
			</c:if>
			<c:forEach items="${list }" var="l">
				<tr class="text-c">
					<c:if test="${l.satff_status==0}"><th></th></c:if>
					<c:if test="${ l.satff_status==1}">
					<th><input  class="item-check" name="" type="checkbox" value="${l.staff_id}"></th>
					</c:if>
					<%-- <th>${l.staffName }<th>
					<th>${l.staffSex }</th>
					<th>${l.staffAddress }</th>
					<th>${l.staffPhone }</th>
					<th>${l.staffEmail }</th>
					<th>${l.staffPositionId }</th>
					<th>${l.staffDeptId }</th>
					<th>${l.staffEntrytime }</th>
					<th><a href=""><span class="label label-success radius">删除</span></a></th>	 --%>
					<th width="80">${l.staff_name }</th>
					<c:if test="${l.staff_sex==1 }"><th width="100">男</th></c:if>
					<c:if test="${l.staff_sex==0 }"><th width="100">女</th></c:if>
					<th width="100">${l.staff_address }</th>
					<th width="150">${l.staff_phone }</th>
					<th width="120">${l.staff_email }</th>
					<th width="70">${l.position_name }</th>
					<th width="80">${l.dept_name }</th>
					<c:if test="${l.satff_status==1}"><th width="50">在职</th></c:if>
						<c:if test="${l.satff_status==0}"><th width="50">离职</th></c:if>
					<th width="210">${l.staff_entrytime }</th>
					<c:if test="${l.satff_status==0}">
					<th width="100" style="backgorund:gray">
					删除</th>
					</c:if>
					<c:if test="${l.satff_status==1}">
					<th width="100"><a href="staff?method=delete&id=${l.staff_id}" >
					<span class="label label-success radius" onclick="return confirm('确认该员工已离职?')">离职</span></a>
					<a href="staff?method=update&id=${l.staff_id}" >
					<span class="label label-success radius">修改</span></a></th>
					</c:if>
			</tr>
					</c:forEach>
			</tbody>
		</table>
			<c:if test="${totalPage > 1 }">
			<div class="page">
				<a <c:if test="${page!=1}">href="staff?method=selectby&page=1${queryString}"</c:if>
					class="${page == 1?'disable':''}">首页</a> <a
					<c:if test="${page!=1}">href="staff?method=selectby&page=${page-1}${queryString}"</c:if>
					class="${page == 1?'disable':''}">上一页</a>
					<c:forEach begin="1" end="${totalPage }" var="t">
					<a href="staff?method=selectby&page=${t}${queryString}">${t }</a> 
					</c:forEach><a
					<c:if test="${page!=totalPage}">href="staff?method=selectby&page=${page+1}${queryString}"</c:if>
					class="${page == totalPage?'disable':''}">下一页</a> <span> <a
					<c:if test="${page!=totalPage}">href="staff?method=selectby&page=${totalPage }${queryString}"</c:if>
					class="${page == totalPage?'disable':''}">最后一页</a> </span><span>
					${page}/${ totalPage} </span>
			</div>
		</c:if>
	</div>
</div>
<script src="static/js/jquery-1.12.4.js" type="text/javascript"></script>
<script type="text/javascript" src="static/js/jquery.min.js"></script> 
<script type="text/javascript" src="static/js/layer.js"></script> 
<script type="text/javascript" src="static/js/WdatePicker.js"></script> 
<script type="text/javascript" src="statoc/js/jquery.dataTables.min.js"></script> 
<script type="text/javascript" src="static/js/H-ui.js"></script> 
<script type="text/javascript" src="static/js/H-ui.admin.js"></script> 
<script src="static/js/jquery-1.12.4.js" type="text/javascript"></script>
<script src="static/js/student.js" type="text/javascript"></script>

	 <div id="deptadd">
   		<iframe class="thickframe" id="thickframe" marginwidth="0" marginheight="0" frameborder="1" scrolling="no" style="width: 100%; height: 1162px;">
		
</iframe>
		<div class="thickdiv" id="thickdiv" style="width: 100%; height: 1162px;"></div>
		<div class="thickbox" id="thickbox" style="left: 450.5px; top:80px; width: 402px; height: 482px;">
		<div class="thickwrap" style="width: 760px;">
					<div class="thicktitle" id="" style="width:740"><span>添加员工</span></div>		
						<div class="thickcon" id="" style="width: 400px; height: 470px; padding-left: 20px; padding-right: 20px;">
			<div id="addressDiagDiv">
<div class="m" id="edit-cont">
			<div>
		<!-- 	<span id="xxx">x</span> -->
			</div>
		<form action="staff?method=insert" method="post" class="form">
			<table>
				<tr>
					<td></td>
					<td><div id="hint"></div></td>
				</tr>
				<tr>
					<td>姓名</td>
					<td><input id="name1" style="width:200px;height:30px;" name="name" type="text" class="text" ></td>
				</tr>
				<tr>
						<td>性别</td>
						<td><input type="radio" value="1" name="sex" checked="checked" >男<input type="radio" value="0" name="sex" value="0">女</td>
				</tr>
				<tr>
						<td>地址</td>
						<td><input style="width:200px;height:30px;" id="address"  name="address" type="text" class="text" ></td>
				</tr>
				<tr>
						<td>密码</td>
						<td><input style="width:200px;height:30px;" id="pwd"  name="pwd" type="password" class="text" ></td>
				</tr>
				<tr>
						<td>电话</td>
						<td><input  style="width:200px;height:30px;" id="phone"  name="phone" type="text" class="text" ></td>
				</tr>
					<tr>
					<td>邮箱</td>
					<td><input style="width:200px;height:30px;"  id="email"  name="email"  type="text" class="text" ></td>
				</tr>
				<tr>
						<td>职位</td>
						<td>
						<select name="position" style="width:200px;height:30px;">
						<c:forEach items="${poslist }" var="pos">
						<option value="${pos.positionId}">${pos.positionName }</option>
						</c:forEach>
						</select>
						</td>
				</tr>
				<tr>
						<td>部门</td>
						<td>
						<select name="dept" style="width:200px;height:30px;">
						<c:forEach items="${deptlist }" var="dept">
						<option value="${dept.deptId}">${dept.deptName }</option>
						</c:forEach>
						</select>
						</td>
				</tr>
				
				<tr>
					<td id="zeng"><input style="border-radius:4px;width:61px;height:30px;cursor: pointer" type="submit" value="确定新增" id="button"></td>
					<td id="qu"><input style="border-radius:4px;width:61px;height:30px;cursor: pointer" type="button" value="取消"></td>
				</tr>
			
			</table>
		</form>
	</div></div>
</div></div>
</div>
</div>
</body>
</html>